/**
 * Project Name:fastPlat
 * File Name:FeedbackServiceImpl.java
 * Package Name:com.fast.cms.service.article.impl
 * Date:2017年05月27日 17时48分32秒
 * Copyright (c) 2017, lsflu@126.com All Rights Reserved.
 *
*/

package com.fast.cms.service.article.impl;

import org.springframework.stereotype.Service;

import com.fast.base.dao.daoSuport.JpaDaoSupport;
import com.fast.base.db.page.PageView;
import com.fast.base.db.page.QueryResult;
import com.fast.cms.service.article.FeedbackService;
import com.fast.cms.web.form.FeedbackForm;
import com.fast.cms.model.article.Feedback;

/**
 * ClassName:FeedbackServiceImpl <br/>
 * 用途: 意见反馈服务实现 <br/>
 * 开发人员：lushuifa  http://lushuifa.iteye.com/
 * 邮箱:lsflu@126.com
 * @version  1.0
 * @since    JDK 1.6
 * @see
 * Date:     2017年05月27日 17时48分32秒 <br/> 	 
 */
@Service("feedbackService")
public class FeedbackServiceImpl extends JpaDaoSupport implements FeedbackService {

    /**
	 * 分页获取意见反馈列表
	 * @return PageView<Feedback>
	 */
	@Override
	public PageView<Feedback> getFeedbackList(FeedbackForm feedbackForm){
		StringBuffer sb = new StringBuffer(" where 1=1 ");
		sb.append("and delete_flag="+feedbackForm.getDeleteFlag()+" ");
		String ordersql = " order by edit_time desc ";
		QueryResult<Feedback>  queryResult = super.queryForBeanListByPage(Feedback.class,sb.toString(),ordersql,(feedbackForm.getRows()-1)*feedbackForm.getRows(),feedbackForm.getRows());
		PageView<Feedback> pageView = new PageView<Feedback>();
	    pageView.setCurrentPage(feedbackForm.getPage());
		pageView.setQueryResult(queryResult);
 		return pageView;
	}
}

